package com.ysd.lis.controller.lab;


import com.ysd.common.Result;
import com.ysd.lis.annotation.LogDetail;
import com.ysd.lis.aspect.OperationType;
import com.ysd.lis.controller.pub.BaseController;
import com.ysd.lis.entity.lab.LabMaininfoXsGroup;
import com.ysd.lis.request.AddAndUpdateCancleauditGroup;
import com.ysd.lis.request.DeleteParam;
import com.ysd.lis.service.lab.LabMaininfoXsGroupService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 消审原因设置表 前端控制器 
 * </p>
 *
 * @author Bai
 * @since 2024-02-02
 */
@RestController
@RequestMapping("/lab/cancleaudit/group")
public class LabMaininfoGroupController extends BaseController {
    @Autowired
    LabMaininfoXsGroupService labMaininfoXsGroupService;

    //获取不合规信息
    @ApiOperation("获取消审原因信息（不分页)")
    @GetMapping("/getCancleauditListNoPage")
    public Result getCancleauditListNoPage(LabMaininfoXsGroup labUnqualifiedGroup) {
        return labMaininfoXsGroupService.getCancleauditList(labUnqualifiedGroup);
    }

    //新增消审原因组信息
    @ApiOperation("新增消审原因组信息")
    @PostMapping("/addGroup")
    @LogDetail(requestParam = "addGroup", operationType = OperationType.INSERT, module = "消审原因管理", content = "通过检验模块，使用消审原因设置功能新增了：【groupNames】消审原因组")
    public Result addGroup(@RequestBody AddAndUpdateCancleauditGroup addAndUpdateUnqualiGroup) {
        return labMaininfoXsGroupService.addGroup(addAndUpdateUnqualiGroup);
    }
    @ApiOperation("修改消审原因组信息")
    @PostMapping("/updateGroup")
    @LogDetail(requestParam = "updateGroup", operationType = OperationType.UPDATE, module = "消审原因管理", content = "通过检验模块，使用消审原因设置功能修改了：【groupNames】消审原因组")
    public Result updateGroup(@RequestBody AddAndUpdateCancleauditGroup addAndUpdateUnqualiGroup) {
        return labMaininfoXsGroupService.updateGroup(addAndUpdateUnqualiGroup);
    }

    @ApiOperation("删除消审原因组信息")
    @PostMapping("/daleteGroup")
    @LogDetail(requestParam = "daleteGroup", operationType = OperationType.DELETE, module = "消审原因管理", content = "通过检验模块，使用消审原因设置功能删除了：【names】消审原因组")
    public Result daleteGroup(@RequestBody DeleteParam deleteParam) {
        return labMaininfoXsGroupService.daleteGroup(deleteParam);
    }
}